<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="HTML,CSS," />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="CSS Cascading style sheets&amp;#x5199;&amp;#x6CD5;
&amp;#x5185;&amp;#x5D4C;&amp;#x5F0F;
&amp;#x5916;&amp;#x94FE;&amp;#x5F0F;

1&amp;lt;link rel=&amp;#x201D;stylesheet&amp;#x201D; herf=&amp;#x201D;1.css&amp;#x201D;&amp;gt;

&amp;#x884C;&amp;#x5185;&amp;#x6837;&amp;#x5F0F;">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML元素分类、伪类、背景图片">
<meta property="og:url" content="https://hongqinma.github.io/2013/09/17/HTML元素分类、伪类、背景图片/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="CSS Cascading style sheets&amp;#x5199;&amp;#x6CD5;
&amp;#x5185;&amp;#x5D4C;&amp;#x5F0F;
&amp;#x5916;&amp;#x94FE;&amp;#x5F0F;

1&amp;lt;link rel=&amp;#x201D;stylesheet&amp;#x201D; herf=&amp;#x201D;1.css&amp;#x201D;&amp;gt;

&amp;#x884C;&amp;#x5185;&amp;#x6837;&amp;#x5F0F;">
<meta property="og:updated_time" content="2016-11-02T23:42:31.686Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HTML元素分类、伪类、背景图片">
<meta name="twitter:description" content="CSS Cascading style sheets&amp;#x5199;&amp;#x6CD5;
&amp;#x5185;&amp;#x5D4C;&amp;#x5F0F;
&amp;#x5916;&amp;#x94FE;&amp;#x5F0F;

1&amp;lt;link rel=&amp;#x201D;stylesheet&amp;#x201D; herf=&amp;#x201D;1.css&amp;#x201D;&amp;gt;

&amp;#x884C;&amp;#x5185;&amp;#x6837;&amp;#x5F0F;">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/2013/09/17/HTML元素分类、伪类、背景图片/"/>


  <title> HTML元素分类、伪类、背景图片 | HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                HTML元素分类、伪类、背景图片
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2013-09-17T20:42:33+08:00" content="2013-09-17">
              2013-09-17
            </time>
          </span>

          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2013/09/17/HTML元素分类、伪类、背景图片/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2013/09/17/HTML元素分类、伪类、背景图片/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          
              &nbsp; | &nbsp;
              <span class="page-pv"><i class="fa fa-file-o"></i>
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
              </span>
          

          
            <span id="busuanzi_container_page_pv">  <span id="busuanzi_value_page_pv"></span> Views</span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="CSS-Cascading-style-sheets&#x5199;&#x6CD5;"><a href="#CSS-Cascading-style-sheets&#x5199;&#x6CD5;" class="headerlink" title="CSS Cascading style sheets&#x5199;&#x6CD5;"></a>CSS Cascading style sheets&#x5199;&#x6CD5;</h2><ul>
<li>&#x5185;&#x5D4C;&#x5F0F;</li>
<li>&#x5916;&#x94FE;&#x5F0F;</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">&lt;link rel=&#x201D;stylesheet&#x201D; herf=&#x201D;1.css&#x201D;&gt;</div></pre></td></tr></table></figure>
<ul>
<li>&#x884C;&#x5185;&#x6837;&#x5F0F;</li>
</ul>
<h3 id="&#x4E09;&#x79CD;&#x6837;&#x5F0F;&#x5199;&#x6CD5;&#x7684;&#x533A;&#x522B;"><a href="#&#x4E09;&#x79CD;&#x6837;&#x5F0F;&#x5199;&#x6CD5;&#x7684;&#x533A;&#x522B;" class="headerlink" title="&#x4E09;&#x79CD;&#x6837;&#x5F0F;&#x5199;&#x6CD5;&#x7684;&#x533A;&#x522B;"></a>&#x4E09;&#x79CD;&#x6837;&#x5F0F;&#x5199;&#x6CD5;&#x7684;&#x533A;&#x522B;</h3><ul>
<li>&#x5185;&#x5D4C;&#x6837;&#x5F0F;&#x8868;&#xFF1A;<ul>
<li>&#x5F71;&#x54CD;&#x8303;&#x56F4;&#x9650;&#x4E8E;&#x5F53;&#x524D;&#x9875;&#x9762;&#xFF0C;&#x5176;&#x4ED6;&#x9875;&#x9762;&#x65E0;&#x6548;&#xFF0C;&#x4E0D;&#x80FD;&#x771F;&#x6B63;&#x5B9E;&#x73B0;&#x7ED3;&#x6784;&#x548C;&#x8868;&#x73B0;&#x89E3;&#x8026;</li>
</ul>
</li>
<li>&#x5916;&#x94FE;&#x6837;&#x5F0F;&#x8868;<ul>
<li>&#x5F71;&#x54CD;&#x8303;&#x56F4;&#x5927;&#xFF0C;&#x662F;&#x6574;&#x4E2A;&#x7AD9;&#x70B9;&#xFF0C;&#x5B9E;&#x73B0;&#x771F;&#x6B63;&#x7684;&#x7ED3;&#x6784;&#x8868;&#x73B0;&#x5206;&#x79BB;</li>
</ul>
</li>
<li>&#x884C;&#x5185;&#x6837;&#x5F0F;&#x8868;&#xFF1A;<ul>
<li>&#x4EC5;&#x9650;&#x4E8E;&#x5F53;&#x524D;&#x6807;&#x7B7E;&#xFF0C;&#x4F5C;&#x7528;&#x8303;&#x56F4;&#x5C0F;&#x3002;&#x7ED3;&#x6784;&#x548C;&#x8868;&#x73B0;&#x5B8C;&#x5168;&#x8026;&#x5408;</li>
</ul>
</li>
</ul>
<h3 id="link-&#x548C;-import&#x533A;&#x522B;"><a href="#link-&#x548C;-import&#x533A;&#x522B;" class="headerlink" title="link &#x548C; @import&#x533A;&#x522B;"></a>link &#x548C; @import&#x533A;&#x522B;</h3><ul>
<li>link&#x5C5E;&#x4E8E;HTML&#x6807;&#x7B7E;&#xFF0C;&#x800C;@import&#x662F;CSS&#x63D0;&#x4F9B;&#x7684;</li>
<li>&#x9875;&#x9762;&#x52A0;&#x8F7D;&#x65F6;&#xFF0C;link&#x4F1A;&#x540C;&#x65F6;&#x52A0;&#x8F7D;&#xFF0C;&#x800C;@import&#x5F15;&#x5165;&#x7684;CSS&#x8981;&#x7B49;&#x5230;&#x9875;&#x9762;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x5143;&#x7D20;&#x52A0;&#x8F7D;&#x5B8C;&#x518D;&#x52A0;&#x8F7D;</li>
<li>@import&#x6709;&#x517C;&#x5BB9;&#x6027;&#xFF0C;&#x800C;link&#x662F;HTML&#x6807;&#x7B7E;&#xFF0C;&#x65E0;&#x517C;&#x5BB9;&#x6027;&#x95EE;&#x9898;</li>
<li>link&#x65B9;&#x5F0F;&#x7684;&#x6837;&#x5F0F;&#x7684;&#x6743;&#x91CD;&#x9AD8;&#x4E8E;@import&#x7684;&#x6743;&#x91CD;</li>
<li>link&#x5F15;&#x5165;&#x7684;CSS&#x652F;&#x6301;js&#x4FEE;&#x6539;&#x6837;&#x5F0F;&#xFF0C;&#x800C;@import&#x5BFC;&#x5165;&#x7684;CSS&#x4E0D;&#x80FD;&#x88AB;js&#x4EE3;&#x7801;&#x4FEE;&#x6539;&#x6837;&#x5F0F;&#xFF1B;</li>
</ul>
<h2 id="html&#x5206;&#x7C7B;-&#x663E;&#x793A;&#x65B9;&#x5F0F;"><a href="#html&#x5206;&#x7C7B;-&#x663E;&#x793A;&#x65B9;&#x5F0F;" class="headerlink" title="html&#x5206;&#x7C7B;(&#x663E;&#x793A;&#x65B9;&#x5F0F;)"></a>html&#x5206;&#x7C7B;(&#x663E;&#x793A;&#x65B9;&#x5F0F;)</h2><h3 id="&#x5757;&#x5143;&#x7D20;"><a href="#&#x5757;&#x5143;&#x7D20;" class="headerlink" title="&#x5757;&#x5143;&#x7D20;"></a>&#x5757;&#x5143;&#x7D20;</h3><p>&#x6700;&#x5E38;&#x7528;&#x7684;&#x6709;&#xFF1A; <code>div</code>, <code>p</code>, <code>li</code>, <code>h1-h6</code></p>
<p>&#x7279;&#x70B9;&#xFF1A;</p>
<ul>
<li>&#x72EC;&#x5360;&#x4E00;&#x884C;</li>
<li>&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x5BBD;&#x5EA6;&#x548C;&#x9AD8;&#x5EA6;</li>
<li>&#x5305;&#x542B;&#x5173;&#x7CFB;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x7236;&#x5143;&#x7D20;&#x548C;&#x5B50;&#x5143;&#x7D20;&#x90FD;&#x4E3A;&#x5757;&#x5143;&#x7D20;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x5EA6;&#x7B49;&#x4E8E;&#x7236;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x5EA6;</li>
</ul>
<h3 id="&#x884C;&#x5185;&#x5143;&#x7D20;&#xFF08;&#x5185;&#x8054;&#x5143;&#x7D20;&#xFF09;"><a href="#&#x884C;&#x5185;&#x5143;&#x7D20;&#xFF08;&#x5185;&#x8054;&#x5143;&#x7D20;&#xFF09;" class="headerlink" title="&#x884C;&#x5185;&#x5143;&#x7D20;&#xFF08;&#x5185;&#x8054;&#x5143;&#x7D20;&#xFF09;"></a>&#x884C;&#x5185;&#x5143;&#x7D20;&#xFF08;&#x5185;&#x8054;&#x5143;&#x7D20;&#xFF09;</h3><p>&#x5178;&#x578B;&#x4EE3;&#x8868;&#xFF1A;strong span a em b del s ins i u</p>
<p>&#x7279;&#x70B9;&#xFF1A;</p>
<ul>
<li>&#x4E0D;&#x80FD;&#x8BBE;&#x7F6E;&#x5BBD;&#x9AD8;&#xFF0C;</li>
<li>&#x5BBD;&#x9AD8;&#x5EA6;&#x7531;&#x5185;&#x5BB9;&#x6491;&#x5F00;</li>
<li>&#x5728;&#x4E00;&#x884C;&#x4E0A;&#x663E;&#x793A;</li>
</ul>
<h3 id="&#x884C;&#x5185;&#x5757;&#x5143;&#x7D20;"><a href="#&#x884C;&#x5185;&#x5757;&#x5143;&#x7D20;" class="headerlink" title="&#x884C;&#x5185;&#x5757;&#x5143;&#x7D20;"></a>&#x884C;&#x5185;&#x5757;&#x5143;&#x7D20;</h3><p>&#x5178;&#x578B;&#x4EE3;&#x8868;img input</p>
<p>&#x7279;&#x70B9;&#xFF1A;</p>
<ul>
<li>&#x5728;&#x4E00;&#x884C;&#x663E;&#x793A;</li>
<li>&#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x5BBD;&#x9AD8;</li>
</ul>
<h3 id="&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#x7684;&#x8F6C;&#x6362;"><a href="#&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#x7684;&#x8F6C;&#x6362;" class="headerlink" title="&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#x7684;&#x8F6C;&#x6362;"></a>&#x5143;&#x7D20;&#x4E4B;&#x95F4;&#x7684;&#x8F6C;&#x6362;</h3><ul>
<li>&#x884C;&#x5185;&#x5143;&#x7D20;&#x8F6C;&#x6210;&#x5757;&#x7EA7;&#x5143;&#x7D20;</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">display:block;</div></pre></td></tr></table></figure>
<ul>
<li>&#x5757;&#x7EA7;&#x5143;&#x7D20;&#x8F6C;&#x6210;&#x884C;&#x5185;&#x5143;&#x7D20;</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">display:inline-block;</div></pre></td></tr></table></figure>
<ul>
<li>&#x5757;&#x5143;&#x7D20;&#x8F6C;&#x6210;&#x884C;&#x5185;&#x5143;&#x7D20;</li>
<li>&#x5757;&#x3001;&#x884C;&#x5185;&#x5143;&#x7D20;&#x8F6C;&#x6210;&#x884C;&#x5185;&#x5757;&#x5143;&#x7D20;</li>
</ul>
<h2 id="css&#x7279;&#x6027;"><a href="#css&#x7279;&#x6027;" class="headerlink" title="css&#x7279;&#x6027;"></a>css&#x7279;&#x6027;</h2><h3 id="&#x5C42;&#x53E0;&#x6027;"><a href="#&#x5C42;&#x53E0;&#x6027;" class="headerlink" title="&#x5C42;&#x53E0;&#x6027;"></a>&#x5C42;&#x53E0;&#x6027;</h3><p>&#x5F53;&#x6837;&#x5F0F;&#x5C5E;&#x6027;&#x51B2;&#x7A81;&#x65F6;&#xFF0C;&#x6267;&#x884C;&#x65F6;&#x662F;&#x6700;&#x540E;&#x9762;&#x6837;&#x5F0F;&#x3002;&#x548C;&#x6807;&#x7B7E;&#x8C03;&#x7528;&#x987A;&#x5E8F;&#x65E0;&#x5173;&#x3002;</p>
<h3 id="&#x7EE7;&#x627F;&#x6027;"><a href="#&#x7EE7;&#x627F;&#x6027;" class="headerlink" title="&#x7EE7;&#x627F;&#x6027;"></a>&#x7EE7;&#x627F;&#x6027;</h3><ul>
<li>&#x6761;&#x4EF6;&#xFF1A;&#x5305;&#x542B;&#x5173;&#x7CFB;</li>
<li>&#x666E;&#x904D;&#x6027;&#xFF1A;&#x6587;&#x672C;&#x5927;&#x5C0F;&#x3001;&#x5B57;&#x4F53;&#x3001;&#x7C97;&#x7EC6;&#x3001;&#x989C;&#x8272;&#x3001;&#x884C;&#x9AD8;&#x3001;&#x98CE;&#x683C;&#x6837;&#x5F0F;&#x88AB;&#x7EE7;&#x627F;</li>
<li><p>&#x7279;&#x6B8A;&#x6027;&#xFF1A;</p>
<ul>
<li>&#x6807;&#x9898;&#x6807;&#x7B7E;&#x4E0D;&#x4F1A;&#x7EE7;&#x627F;&#xFF0C;&#x4F46;&#x53D7;&#x7236;&#x7EA7;&#x5143;&#x7D20;&#x7684;&#x5F71;&#x54CD;&#xFF0C;&#x6587;&#x5B57;&#x5927;&#x5C0F;&#x3002;</li>
<li>a&#x6807;&#x7B7E;&#x4E0D;&#x4F1A;&#x7EE7;&#x627F;&#x7236;&#x5143;&#x7D20;&#x7684;&#x6587;&#x5B57;&#x989C;&#x8272;&#x3002;</li>
</ul>
</li>
<li><p>&#x4E0D;&#x53EF;&#x7EE7;&#x627F;&#x7684;&#xFF1A;display&#x3001;margin&#x3001;border&#x3001;padding&#x3001;background&#x3001;height&#x3001;min-height&#x3001;max-height&#x3001;width&#x3001;min-width&#x3001;max-width&#x3001;overflow&#x3001;position&#x3001;left&#x3001;right&#x3001;top&#x3001;bottom&#x3001;z-index&#x3001;float&#x3001;clear&#x3001;table-layout&#x3001;vertical-align&#x3001;page-break-after&#x3001;page-bread-before&#x548C;unicode-bidi&#x3002;</p>
</li>
<li>&#x6240;&#x6709;&#x5143;&#x7D20;&#x53EF;&#x7EE7;&#x627F;&#xFF1A;visibility&#x548C;cursor&#x3002;</li>
<li>&#x5185;&#x8054;&#x5143;&#x7D20;&#x53EF;&#x7EE7;&#x627F;&#xFF1A;letter-spacing&#x3001;word-spacing&#x3001;white-space&#x3001;line-height&#x3001;color&#x3001;font&#x3001;font-family&#x3001;font-size&#x3001;font-style&#x3001;font-variant&#x3001;font-weight&#x3001;text-decoration&#x3001;text-transform&#x3001;direction&#x3002;</li>
<li>&#x7EC8;&#x7AEF;&#x5757;&#x72B6;&#x5143;&#x7D20;&#x53EF;&#x7EE7;&#x627F;&#xFF1A;text-indent&#x548C;text-align&#x3002;</li>
<li>&#x5217;&#x8868;&#x5143;&#x7D20;&#x53EF;&#x7EE7;&#x627F;&#xFF1A;list-style&#x3001;list-style-type&#x3001;list-style-position&#x3001;list-style-image&#x3002;</li>
<li>&#x6587;&#x5B57;&#x7684;&#x6240;&#x6709;&#x5C5E;&#x6027;&#x53EF;&#x4EE5;&#x7EE7;&#x627F;&#xFF0C;&#x884C;&#x9AD8;&#x4E5F;&#x53EF;&#x4EE5;&#x7EE7;&#x627F;, &#x4F46;a&#x6807;&#x7B7E;&#x4E0D;&#x7EE7;&#x627F;&#x6587;&#x5B57;&#x989C;&#x8272;</li>
</ul>
<h3 id="&#x4F18;&#x5148;&#x7EA7;"><a href="#&#x4F18;&#x5148;&#x7EA7;" class="headerlink" title="&#x4F18;&#x5148;&#x7EA7;"></a>&#x4F18;&#x5148;&#x7EA7;</h3><ul>
<li>!important &gt; &#x884C;&#x5185;&#x6837;&#x5F0F; &gt; id&#x9009;&#x62E9;&#x5668; &gt; &#x7C7B;&#x9009;&#x62E9;&#x5668; &gt; &#x6807;&#x7B7E;&#x9009;&#x62E9;&#x5668; &gt; &#x9ED8;&#x8BA4;</li>
<li>1000&#x4EE5;&#x4E0A;  1000        100        10          1        0</li>
</ul>
<p>&#x7EE7;&#x627F;&#x7684;&#x6743;&#x91CD;&#x4E3A;0, &#x6743;&#x91CD;&#x4F1A;&#x53E0;&#x52A0;</p>
<h2 id="&#x8FDE;&#x63A5;&#x4F2A;&#x7C7B;"><a href="#&#x8FDE;&#x63A5;&#x4F2A;&#x7C7B;" class="headerlink" title="&#x8FDE;&#x63A5;&#x4F2A;&#x7C7B;"></a>&#x8FDE;&#x63A5;&#x4F2A;&#x7C7B;</h2><p><code>a:link{&#x5C5E;&#x6027;:&#x503C;;}</code>, &#x6CA1;&#x6709;&#x70B9;&#x51FB;&#x65F6;&#x9ED8;&#x8BA4;&#x72B6;&#x6001; a{&#x5C5E;&#x6027;:&#x503C;;} &#x4E00;&#x822C;&#x5199;&#x8FD9;&#x4E2A;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line">a:link{</div><div class="line">  /*&#x8FDE;&#x63A5;&#x9ED8;&#x8BA4;&#x72B6;&#x6001;*/</div><div class="line">  &#x5C5E;&#x6027;:&#x503C;;</div><div class="line">}</div><div class="line">a:visited{</div><div class="line">  /*&#x8FDE;&#x63A5;&#x8BBF;&#x95EE;&#x4E4B;&#x540E;&#x7684;&#x72B6;&#x6001;*/</div><div class="line">  &#x5C5E;&#x6027;:&#x503C;;</div><div class="line">}</div><div class="line">a:hover{        </div><div class="line">  /*&#x9F20;&#x6807;&#x653E;&#x4E0A;&#x53BB;&#x663E;&#x793A;&#x7684;&#x72B6;&#x6001;*/</div><div class="line">  &#x5C5E;&#x6027;:&#x503C;;</div><div class="line">}</div><div class="line">a:active{</div><div class="line">  /*&#x8FDE;&#x63A5;&#x6FC0;&#x6D3B;&#x7684;&#x72B6;&#x6001;*/</div><div class="line">  &#x5C5E;&#x6027;:&#x503C;;</div><div class="line">}</div><div class="line">a:focus{</div><div class="line">  /*&#x83B7;&#x53D6;&#x8F83;&#x5927;*/</div><div class="line">  &#x5C5E;&#x6027;:&#x503C;;</div><div class="line">}</div></pre></td></tr></table></figure>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x8FDE;&#x63A5;&#x4F2A;&#x7C7B;&#x7684;&#x987A;&#x5E8F;&#x4E0D;&#x80FD;&#x9519;&#xFF1B;</p>
<ul>
<li>text-decoration &#x6587;&#x672C;&#x4FEE;&#x9970;</li>
<li>text-decoration: none; &#x53BB;&#x6389;a&#x6807;&#x7B7E;&#x7684;&#x9ED8;&#x8BA4;&#x6837;&#x5F0F;&#x7684;&#x4E0B;&#x5212;&#x7EBF;</li>
<li>text-decoration: underline; &#x52A0;&#x4E0A;&#x4E0B;&#x5212;&#x7EBF;</li>
<li>text-decoration: line-through; &#x5220;&#x9664;&#x7EBF;</li>
</ul>
<h2 id="&#x80CC;&#x666F;"><a href="#&#x80CC;&#x666F;" class="headerlink" title="&#x80CC;&#x666F;"></a>&#x80CC;&#x666F;</h2><ul>
<li>background-color</li>
</ul>
<h3 id="background-image"><a href="#background-image" class="headerlink" title="background-image"></a>background-image</h3><ul>
<li>background-repeat &#x80CC;&#x666F;&#x56FE;&#x7247;&#x6CBF;&#x7740;x&#x8F74;&#x5E73;&#x94FA;</li>
<li>background-position left|right|top|bottom|center &#x80CC;&#x666F;&#x5B9A;&#x4F4D;&#x5199;&#x5177;&#x4F53;&#x65B9;&#x4F4D;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4E66;&#x5199;&#x987A;&#x5E8F;&#x6CA1;&#x6709;&#x9650;&#x5236;</li>
<li>background-attchment scroll|fixed<ul>
<li>scroll &#x80CC;&#x666F;&#x6EDA;&#x52A8; &#x9ED8;&#x8BA4;</li>
<li>fixed &#x80CC;&#x666F;&#x56FA;&#x5B9A;</li>
</ul>
</li>
</ul>
<h3 id="&#x80CC;&#x666F;&#x5C5E;&#x6027;&#x8FDE;&#x5199;"><a href="#&#x80CC;&#x666F;&#x5C5E;&#x6027;&#x8FDE;&#x5199;" class="headerlink" title="&#x80CC;&#x666F;&#x5C5E;&#x6027;&#x8FDE;&#x5199;"></a>&#x80CC;&#x666F;&#x5C5E;&#x6027;&#x8FDE;&#x5199;</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">background: color imge repeat position attachment</div></pre></td></tr></table></figure>
<p>&#x7279;&#x70B9;&#xFF1A;&#x6CA1;&#x6709;&#x987A;&#x5E8F;&#x8981;&#x6C42;</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>感谢您的支持！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>打 赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ofy7k3v4s.bkt.clouddn.com/wcpayCode.jpg" alt="Hongqin Ma WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ofy7k3v4s.bkt.clouddn.com/apayCode.jpg" alt="Hongqin Ma Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/HTML/" rel="tag">#HTML</a>
          
            <a href="/tags/CSS/" rel="tag">#CSS</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2013/09/10/CSS样式表、选择器-md/" rel="next" title="CSS样式表、CSS选择器">
                <i class="fa fa-chevron-left"></i> CSS样式表、CSS选择器
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2014/03/07/01-js-初识/" rel="prev" title="js 初识">
                js 初识 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2013/09/17/HTML元素分类、伪类、背景图片/"
     data-title="HTML元素分类、伪类、背景图片"
     data-content=""
     data-url="https://hongqinma.github.io/2013/09/17/HTML元素分类、伪类、背景图片/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2013/09/17/HTML元素分类、伪类、背景图片/"
           data-title="HTML元素分类、伪类、背景图片" data-url="https://hongqinma.github.io/2013/09/17/HTML元素分类、伪类、背景图片/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">68</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#CSS-Cascading-style-sheets写法"><span class="nav-number">1.</span> <span class="nav-text">CSS Cascading style sheets写法</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#三种样式写法的区别"><span class="nav-number">1.1.</span> <span class="nav-text">三种样式写法的区别</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#link-和-import区别"><span class="nav-number">1.2.</span> <span class="nav-text">link 和 @import区别</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#html分类-显示方式"><span class="nav-number">2.</span> <span class="nav-text">html分类(显示方式)</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#块元素"><span class="nav-number">2.1.</span> <span class="nav-text">块元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#行内元素（内联元素）"><span class="nav-number">2.2.</span> <span class="nav-text">行内元素（内联元素）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#行内块元素"><span class="nav-number">2.3.</span> <span class="nav-text">行内块元素</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#元素之间的转换"><span class="nav-number">2.4.</span> <span class="nav-text">元素之间的转换</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#css特性"><span class="nav-number">3.</span> <span class="nav-text">css特性</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#层叠性"><span class="nav-number">3.1.</span> <span class="nav-text">层叠性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#继承性"><span class="nav-number">3.2.</span> <span class="nav-text">继承性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#优先级"><span class="nav-number">3.3.</span> <span class="nav-text">优先级</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#连接伪类"><span class="nav-number">4.</span> <span class="nav-text">连接伪类</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#背景"><span class="nav-number">5.</span> <span class="nav-text">背景</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#background-image"><span class="nav-number">5.1.</span> <span class="nav-text">background-image</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#背景属性连写"><span class="nav-number">5.2.</span> <span class="nav-text">背景属性连写</span></a></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
